package com.example.actordemo4.cluster;

import akka.actor.ActorSystem;
import akka.actor.Address;
import akka.actor.Props;
import akka.cluster.Cluster;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;

public class Cluster1 {

    public static void main(String[] args) {
        Config config = ConfigFactory.parseString("akka.remote.netty.tcp.port=2555");
        ActorSystem actorSystem = ActorSystem.create("sys", config);
        actorSystem.actorOf(Props.create(ClusterActor.class),"clusterActor");
        Cluster cluster= Cluster.get(actorSystem) ;
        Address address = new Address ("akka tcp","sys","127.0.0.1", 2551);
        cluster.join(address);
    }
}
